<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Rationale</title>
<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../string_algo.html" title="Chapter 2. Boost String Algorithms Library">
<link rel="prev" href="../boost/algorithm/trim_fill.html" title="Function template trim_fill">
<link rel="next" href="env.html" title="Environment">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
<td align="center"><a href="../../../index.html">Home</a></td>
<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../boost/algorithm/trim_fill.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../string_algo.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="env.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="string_algo.rationale"></a>Rationale</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="rationale.html#id-1.3.3.10.2">Locales</a></span></dt>
<dt><span class="section"><a href="rationale.html#string_algo.regex">Regular Expressions</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="id-1.3.3.10.2"></a>Locales</h3></div></div></div>
<p>
            Locales have a very close relation to string processing. They contain information about
            the character sets and are used, for example, to change the case of characters and 
            to classify the characters. 
        </p>
<p>
            C++ allows to work with multiple different instances of locales at once. If an algorithm
            manipulates some data in a way that requires the usage of locales, there must be a way
            to specify them. However, one instance of locales is sufficient for most of the applications,
            and for a user it could be very tedious to specify which locales to use at every place 
            where it is needed. 
        </p>
<p>
            Fortunately, the C++ standard allows to specify the <span class="emphasis"><em>global</em></span> locales (using static member
            function <code class="computeroutput">std:locale::global()</code>). When instantiating an
            <code class="computeroutput">std::locale</code> class without explicit information, the instance will 
            be initialized with the <span class="emphasis"><em>global</em></span> locale. This implies, that if an algorithm needs a locale,
            it should have an <code class="computeroutput">std::locale</code> parameter defaulting to  <code class="computeroutput">std::locale()</code>.
            If a user needs to specify locales explicitly, she can do so. Otherwise the <span class="emphasis"><em>global</em></span>
            locales are used.
        </p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="string_algo.regex"></a>Regular Expressions</h3></div></div></div>
<p>
            Regular expressions are an essential part of text processing. For this reason, the library 
            also provides regex variants of some algorithms. The library does not attempt to replace
            Boost.Regex; it merely wraps its functionality in a new interface.
            As a part of this library, regex algorithms integrate smoothly with other components, which 
            brings additional value.
        </p>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2002-2004 Pavol Droba<p>Use, modification and distribution is subject to the Boost
                Software License, Version 1.0. (See accompanying file
                <code class="filename">LICENSE_1_0.txt</code> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
            </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../boost/algorithm/trim_fill.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../string_algo.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="env.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
